package com.zdj.question;

/**
 * @author zhangdj
 * @date 2022-08-26
 */
public class Question2Test {

    public static void main(String[] args) {
//        Integer integer = Integer.valueOf(args[0]);
        getMinSale(5100);
    }

    public static void getMinSale(int income) {
        // 目标提成
        int target = income - 5000;

        if (target < 0) {
            System.out.print("0.00" );
            return;
        }

        // 判断大小
        int boundary1 = 400;
        int boundary2 = 900;

        // 第三档提成
        if (target > boundary2) {
            System.out.printf("%.2f" , (target - boundary2) / 0.12 + 15000);
        }
        // 第一档提成
        if (target <= boundary1) {
            System.out.printf("%.2f" , (target - boundary1) / 0.08 + 5000);
        }
        // 第二档提成
        if (target > boundary1 && target <= boundary2) {
            System.out.printf("%.2f" , (target - boundary1) / 0.1 + 5000);
        }
    }

}
